///////////////////////////////////////////////////////////
///////////////// Have an itch? Scratch it! ///////////////
///////////////////////// SCRATCH /////////////////////////
/////////////////////  A MUD  Server   ////////////////////
///////////////////// By: Jared Devall ////////////////////
/////////////////////      Thanks:     ////////////////////
/////////////////////  DIKU/Merc/ROM   ////////////////////
///////////////////// Aetas/Deus Gang  ////////////////////
/////////////////////       Beej       ////////////////////
///////////////////////////////////////////////////////////

#ifndef __AVATAR_H_
#define __AVATAR_H_

#include "socket.h"
#include "handler.h"
#include <deque>
#include <map>

enum STATUS { LOGIN, CONNECTED };
class Avatar {
	Socket *    _socket;
	std::string _name;
	std::map< std::string, std::string > _info;
	std::string _edit;
	bool        _gotInput;
	bool        _disconnected;
	STATUS      _status;
	// Private Handler Stuff
	void        PopHandler( void );
	
	public:	
	typedef std::deque<Handler *> handlerStack;
				 Avatar( );
				 ~Avatar( );
	STATUS       GetStatus( void );
	void         SetStatus ( STATUS );
	void         Send( char *, ... );
	void         Send( const std::string & );
	Socket *     GetSocket( void );
	void         SetSocket( Socket * );
	bool         SetName( const std::string & );
	bool         VerifyPassword( const std::string & );
	std::string  EncryptPassword( const std::string & );
	void         ClearPassword( void );
	std::string  Get( const std::string & );
	bool         Set( const std::string &, const std::string & );
	void         SetEdit( const std::string & );
	std::string  GetEdit( void );
	bool         HasPassword( void );
	void         FlushOutput( void );
	void         SetDisconnected( bool value );
	bool         IsDisconnected( void );
	void         SetGotInput( bool value );
	bool         GotInput( void );
	bool         Load( void );
	bool         Save( void );
	bool         Create( void );
	bool         Delete( void );
	// Public Handler Stuff
	void	     StackHandler( Handler *);
	void		 ReplaceHandler( Handler *);
	void		 ExitHandler( void );
	void		 HandleInput( const std::string & );
	handlerStack _handlers;
	
};
#endif
